import java.util.Random;
import java.util.Scanner;



public class TestDemo {
    public static void main(String[] args) {
        Random random = new Random();
        int randNum = random.nextInt(100)+1;
        while (true) {
            Scanner scan = new Scanner(System.in);
            System.out.println("请输入要猜的数字（1-100）：");
            int n = scan.nextInt();
            if(n<randNum) {
                System.out.println("低了");
            }else if(n==randNum) {
                System.out.println("猜对了");
                break;
            }else {
                System.out.println("高了");
            }
        }


    }
    public static void main8(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入一个数字：");
        int n = scan.nextInt();
        for(int i = 1;i<=n;i++) {
            for(int j=1;j<=i;j++) {
                System.out.print(i+"*"+j+"="+i*j+"\t");
            }
            System.out.println();
        }
    }
    public static void main7(String[] args) {
        for (int i = 0;i <= 999; i++) {
            int a = i/100;
            int b = (i - a*100)/10;
            int c = i - a*100 - b*10;
            if(a*a*a + b*b*b +c*c*c == i){
                System.out.println(i);
            }
        }
    }
    public static void main6(String[] args) {
        int a = 4;
        int b = 20;
        int c = a%b;
        while (c!=0) {
            a = b;
            b = c;
            c = a%b;
        }
        System.out.println(b);
    }
    public static void main5(String[] args) {
        int i = 1;
        float sum = 0;
        for (; i<=100; i++) {
            if(i%2 == 0){
                sum -= 1f/i;
            }else {
                sum += 1f/i;
            }
        }
        System.out.println(sum);

    }
    public static void main4(String[] args) {
        int a = 24;
        int b = 20;
        int c =a%b;
        while (c!=0) {
            a = b;
            b = c;
            c = a%b;
        }
        System.out.println("最大公约数是："+ b);
    }
    public static void main3(String[] args) {
        int i = 1;
        while (i<=100) {
            if (i%3!=0 || i%5!=0){
                i++;
                continue;
            }
            System.out.println(i);
            i++;

        }
    }
    public static void main2(String[] args) {
        int n =1;
        int sum = 0;
        while (n <=3) {
            int ret = 1;
            int i =1;
            while (i <= n) {
                ret*=i;
                i++;
            }
            n++;
            sum += ret;
        }
        System.out.println(sum);

    }
    public static void main1(String[] args) {
        int i = 1;
        int sum = 0;
        while (i <= 100){
            sum += i;
            i +=2;
        }
        System.out.println(sum);
    }
}
